package com.hjy.ui

import android.os.Bundle
import android.transition.TransitionManager
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity

class ObjectAnimatorActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_object_animator)
    }

    fun onClick(view: View) {
        TransitionManager.beginDelayedTransition(view.parent as ViewGroup)
        with((view.layoutParams as LinearLayout.LayoutParams)) {
            gravity = Gravity.END
            width *= 2
            height *= 2
        }
        view.requestLayout()
    }
}